package com.unei.guava.demo.bujingnian;

import com.google.common.base.Functions;
import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;

/**
 * Created by sunlei on 2015/1/22.
 */
public class Main {
    public static void main(String[] args){
        MsgProcessStrategyFactory factory=new MsgProcessStrategyFactory();
        Supplier<MsgProcessStrategy> factoryIns=Suppliers.memoize(factory);
        MsgProcessStrategy strategy=factoryIns.get();
        Msg m=new Msg(1,"info","haha");
        System.out.println(strategy.apply(m).getContent());

        m=new Msg(1,"warn","gogo");
        System.out.println(strategy.apply(m).getContent());
    }

}
